class AddFieldsToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :username, :string
    add_column :users, :name, :string
    add_column :users, :lastname, :string
    add_column :users, :address, :text
    add_column :users, :phone, :string
    add_column :users, :role, :integer, :default => 1
    add_column :users, :state, :integer, :default => 0
    add_column :users, :cultural_institution, :integer
    add_column :users, :deleted, :integer, :default => 0
  end

  def self.down
    remove_column :users, :deleted
    remove_column :users, :cultural_institution
    remove_column :users, :state
    remove_column :users, :role
    remove_column :users, :phone
    remove_column :users, :address
    remove_column :users, :lastname
    remove_column :users, :name
    remove_column :users, :username
  end
end
